package com.project.mapper.xjProject;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.domain.bo.VProjectDocumentBo;
import com.project.domain.entity.xjProject.BizXjProjectDocument;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface XjProjectDocumentMapper extends BaseMapper<BizXjProjectDocument> {

    /**
     * 获取成员列表(查的视图)
     * @param fileBo
     * @return
     */
    @Select({
            "<script>",
            "select * from v_project_document vpm",
            "where 1=1 ",
            "<if test='memBo.personName != null and memBo.personName != \"\"'>",
            "and vpm.PERSON_NAME like CONCAT('%', CAST(#{memBo.personName} AS CHAR), '%') ",
            "</if>",
            "<if test='memBo.projectId != null and memBo.projectId != \"\"'>",
            "and vpm.PROJECT_ID = '${memBo.projectId}' ",
            "</if>",
            "</script>"
    })
    List<BizXjProjectDocument> getFileList(@Param("fileBo") VProjectDocumentBo fileBo);
}
